namespace CSharpPro._6._2;

public class Demo
{
   // static void Main(string[] args)
   // {
   // Student stu = new Student("张三", 20, "S2024001");
   // stu.DisplayInfo();
   //}

}

public class Student
{
    private string _name;
    private int _age;
    private string _studentId;
    
    public Student(string name, int age, string studentId)
    {
        _name = name;
        _age = age;
        _studentId = studentId;
    }
    
    public string Name
    {
        get => _name;
        set => _name = value;
    }

    public int Age
    {
        get => _age;
        set => _age = value;
    }

    public string StudentId
    {
        get => _studentId;
        set => _studentId = value;
    }
    
    public void DisplayInfo()
    {
        Console.WriteLine($"学号：{_studentId}，姓名：{_name}，年龄：{_age}");
    }
}